/**
 * 实名认证
 */
define(function (require, exports, module) {


    var UI = require("js/UI"),
        uiTip=require("ui/tip");
    var $homeCnt = $("#home .cnt");



    var reg_email=/^([\w\.-]{1,64}@[\w\.-]{1,252}\.\w{2,4})$/;

    var $userForm = $homeCnt.find(".userForm");



    $homeCnt.find(".bindTit.unbind a").unbind("click.name").bind("click.name", function () {
        $userForm.fadeIn();
    })

    $userForm.find("button[type=submit]").unbind("click.sub").bind("click.sub", function () {
        var $email=$userForm.find("input[name=email]"),_email=$.trim($email.val());
        var $number=$userForm.find(".number"),_number=$.trim($number.val());

        if(!_email){
            uiTip($email, "请输入邮箱地址", "right").show();
            $email.focus();
            return false
        }else{
            if(!_email.match(reg_email)){
                uiTip($email, "请输入正确格式的邮箱地址", "right").show();
                $email.focus();
                return false
            }
        }
        if(!_number){
            uiTip($number, "请输入验证码", "right").show();
            $number.focus();
            return false
        }
    });


})